__author__ = 'Me'

from scipy import optimize

def functfact(X,V,NX,NV,):

    #at[0] = Ax
    #at[1] = t
    def mvfx(at):
        out = [
                NX[0] - (0.5*at[0]*at[1]*at[1] + V[0]*at[1] + X[0]),
                NV[0] - (at[0]*at[1] - V[0]),
            ]
        return out
    def mvfy(at):
        out = [
                NX[1] - (0.5*at[0]*at[1]*at[1] + V[1]*at[1] + X[1]),
                NV[1] - (at[0]*at[1] - V[1]),
            ]
        return out

    return [mvfx,mvfy]

MAXAx = 100
MAXAy = 100
tstep = 1

def slv(x,v,nx,nv,a,step):
    f = functfact(x,v,nx,nv)

    print optimize.fsolve(f[0],[0,1])
    print optimize.fsolve(f[1],[0,1])

slv((0,0),(0,0),(1,2),(1,2),(1,1),1)